package xx.iverson.navigation_manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xx.iverson.navigation_manager.entity.Navigation;
import xx.iverson.navigation_manager.mapper.NavigationMapper;
import xx.iverson.navigation_manager.service.NavigationService;

import java.util.Collections;
import java.util.List;
/**
 * xx.iverson.navigation_manager.service.impl.NavigationServiceImpl
 * 描述：
 * on 2025/9/11-下午4:24
 *
 * @author weijx
 */


@Service
public class NavigationServiceImpl implements NavigationService {

    @Autowired
    private NavigationMapper navigationMapper;

    @Override
    public List<Navigation> findAll() {
        return navigationMapper.findAll();
    }

    @Override
    public List<Navigation> findByCategoryId(Integer categoryId) {
        return navigationMapper.findByCategoryId(categoryId);
    }

    @Override
    public Navigation findById(Integer id) {
        return navigationMapper.findById(id);
    }

    @Override
    public int add(Navigation navigation) {
        return navigationMapper.insert(navigation);
    }

    @Override
    public int update(Navigation navigation) {
        return navigationMapper.update(navigation);
    }

    @Override
    public int delete(Integer id) {
        return navigationMapper.delete(id);
    }

    @Override
    public List<Navigation> findWithCategoryName() {
        return navigationMapper.findWithCategoryName();
    }

    @Override
    public List<Navigation> findByCategoryIdNoImage(Integer id) {
        return navigationMapper.findByCategoryIdNoImage(id);
    }
}
